import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

// const testpinia = () => import('@/pinaexam/index.vue')
const ctgy = () => import('@/piniaviews/ctgy/index.vue')
const books = () => import('@/piniaviews/books/index.vue')
const shopcartlist = () => import('@/piniaviews/shopcartlist/shopcartlist.vue')

// 路由配置
const routes: RouteRecordRaw[] = [
  {
    name: 'ctgy',
    path: '/ctgy',
    component: ctgy
  },
  {
    name: 'books',
    path: '/books',
    component: books,
  },
  {
    name: 'shopcartlist',
    path: '/shopcartlist',
    component: shopcartlist
  },
  {
    name: 'default',
    path: '/',
    component: ctgy,
  }
]

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
})

export default router
